<template>
  <a-drawer
    :title="title"
    :visible.sync="drawer"
    :direction="direction"
    size="25%"
    :before-close="handleClose"
  >
    <div class="content">
      <div class="item" v-for="{ key, value } in columns" :key="key">
        <span>{{ key }}:</span>
        <span>{{ data[value] }}</span>
      </div>
    </div>
  </a-drawer>
</template>

<script>
export default {
  components: {},
  props: ["title", "data",'columns'],
  data() {
    return {
      drawer: false,
      direction: "rtl",
    };
  },
  methods: {
    open() {
      console.log(this.columns,this.data);
      this.drawer = true;
    },
    handleClose() {
      this.drawer = false;
    },
  },
  created() {},
};
</script>
<style lang="scss" scoped>
.content {
  display: flex;
  flex-direction: column;
  padding: 20px;

  .item {
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    span:nth-child(1) {
      min-width: 130px;
      display: block;
      font-weight: 400;
      color: #999999;
      line-height: 20px;

    }
    span:nth-child(2) {
      display: block;
      margin-left: 20px;
    }
  }
}

::v-deep .el-drawer__header {
  margin-bottom:0;
  padding: 20px 0 0;
  margin: 0 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #DDDDDD;
  font-size: 16px;
  font-weight: 600;
  color: #333333;
  line-height: 24px;
}
</style>
